From 8fb9d1578d82a496216a632db1c9f50141dedf90 Mon Sep 17 00:00:00 2001 From: Andrew Chadwick Date: Tue, 22 Nov 2016 10:28:40 +0000 Subject: [PATCH] wintab tilt: Check return location for validity https://bugzilla.gnome.org/show_bug.cgi?id=774265 --- gdk/win32/gdkdevicemanager-win32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index f88dab78bd..cd63a77f78 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -800,6 +800,8 @@ decode_tilt (gint *axis_data, { double az, el; + g_return_if_fail (axis_data != NULL); + /* The wintab driver for the Wacom ArtPad II reports * PK_ORIENTATION in CSR_PKTDATA, but the tablet doesn't * actually sense tilt. Catch this by noticing that the @@ -810,7 +812,7 @@ decode_tilt (gint *axis_data, * sensible tilts will need both, so only add the GDK tilt axes * if both wintab axes are going to be well-behaved in use. */ - if ((axes == NULL) || (axis_data == NULL) || + if ((axes == NULL) || (axes[0].axResolution == 0) || (axes[1].axResolution == 0)) { -- 2.30.2